﻿using CallCenter.Data.Base;
using CallCenter.Data.Models;
using CallCenter.Data.Utility;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Hosting;


namespace CallCenter.Data.BizUtilities
{
   public class ContactTypeUtilitycs: BaseUtility
    {
        public ContactTypeUtilitycs(DataManager manager)
            : base(manager) { }


        public List<ContactTypeViewModel> GetContactTypes() //Gets contact types data form the contacts table
        {
           string sql = "SELECT id, description FROM ddlContactTypes WHERE description like 'NONE' UNION ALL   SELECT id, description FROM ddlContactTypes WHERE description <> 'NONE'" ;

            return this.Factory.ExecuteObjects<ContactTypeViewModel>(sql);
        }
    


    public List<ContactGridViewModel> GetJobtitle() //Gets contact types data form the contacts table
    {
        string sql = "SELECT code FROM ddlJobTitle";

        return this.Factory.ExecuteObjects<ContactGridViewModel>(sql);
    }

        public List<ContactGridViewModel> GetDepartments() //Gets contact types data form the contacts table
        {
            string sql = "select code as departmentCode from ddlDepartments";

            return this.Factory.ExecuteObjects<ContactGridViewModel>(sql);
        }
    }


}
